<html lang="zh">
	<head>
		<title>加载中</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" href="/resources/common/reset.css">
		<script type="text/javascript" src="/resources/common/wangEditor.min.js"></script>
		<script type="text/javascript" src="/resources/common/echarts.min.js"></script>
		<script type="text/javascript" src="/resources/common/jsplumb.js"></script>
		<script type="text/javascript" src="/resources/common/vue.global.prod.js"></script>
		<script type="text/javascript" src="/resources/common/dayjs.min.js"></script>
		<script type="text/javascript" src="/resources/common/zh-cn.js"></script>
		<script type="text/javascript" src="/resources/common/plugin/customParseFormat.js"></script>
		<script type="text/javascript" src="/resources/common/plugin/weekday.js"></script>
		<script type="text/javascript" src="/resources/common/plugin/localeData.js"></script>
		<script type="text/javascript" src="/resources/common/plugin/weekOfYear.js"></script>
		<script type="text/javascript" src="/resources/common/plugin/weekYear.js"></script>
		<script type="text/javascript" src="/resources/common/plugin/advancedFormat.js"></script>
		<script type="text/javascript" src="/resources/common/plugin/quarterOfYear.js"></script>
		<script type="text/javascript" src="/resources/common/axios.min.js"></script>
		<script type="text/javascript" src="/resources/common/antd-with-locales.min.js"></script>
		<script type="text/javascript" src="/resources/admin/common.js"></script>
		<script type="text/javascript" src="/page/custom.js"></script>
		<style>
			@import url(/resources/admin/icon/iconfont.css);
			@import url(/resources/admin/common.css);
			@import url(/resources/admin/style.css);
			@import url(/page/custom.css);
		</style>
	</head>
	<body>
	<div id="app">
		<div v-if="showLogin" id="login_page"></div>
		<div v-else id="index_page"></div>
	</div>
	<script type="text/javascript">
		dayjs.locale('zh-cn');
		var app=Vue.createApp({
		data() {
			return {setting:{},showLogin:false};
		},
		mounted() {
			this.loadSystem(function(){
				this.isLogin();
			}.bind(this));
		},
		methods:{
			backHandler:function(){
				this.isLogin();
			},
			isLogin:function(){
				this.requestData('action/manage/adminLogin/isLogin',
					{},
					function(data){
						mo.setting=data.setting;
						mo.powers=data.powers;
						mo.setTheme();
						this.setting=mo.setting;
						if(data.code==0&&null!=data.model){//登录成功
							this.showLogin=false;
							mo.admin=data.model;
							mo.assist=data.assist||{};
							mo.orgGroup=data.orgGroup;
							this.toMainPage();
						}else{//未登录
							this.showLogin=true;
							this.loadPage('login_page',data.loginPage,{codeVerify:data.codeVerify},function(pv,v3){});
						}
					}.bind(this)
				);
			},
			toMainPage:function(){
				this.loadPage('index_page','page/main.js',{},function(pv,v3){
					window.onhashchange = function(){
						pv.doMenu(mo.fn.getHash());
					}
					window.onfocus = function() {
						pv.testLogin();
					}
					let resizeTimer=null;
					window.onresize = function() {
						if(null!=resizeTimer){
							clearTimeout(resizeTimer);
							resizeTimer=null;
						}
						resizeTimer=setTimeout(function(){
							for(let key in mo.pages){
								if(mo.pageV3s[key]['_container'].clientHeight
									&&mo.pages[key].pageFocus){
									mo.pages[key].pageFocus();
								}
							}
						},1000);
					}
				});
			},
			loadSystem:function(fn){
				this.requestData('action/manage/systemInfo/get',
					{},
					function(data){
						if(data.code==0&&null!=data.model){
							mo.system=data.model;
							document.title=mo.system.backgroundTitle;
						}
						if(fn) fn();
					}.bind(this)
				);
			}
		}
	});
	app.mixin(mo.mixin);
	app.use(antd).use(mo.component);
	app.mount('#app');
	</script>
	</body>
</html>
